//
//  ZPQuitClassCell.m
//  ZPIOSEducation
//
//  Created by 李伟 on 2017/1/15.
//  Copyright © 2017年 mini1. All rights reserved.
//

#import "ZPQuitClassCell.h"

@implementation ZPQuitClassCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    ViewRadius(self.eventType, self.eventType.xj_height / 2);
    ViewRadius(self.courseNum, 4);
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setCourse:(NSArray *)course{
    _course = course;
    [self layoutIfNeeded];
    for (UIView *v in _supView.subviews) {
        if (v.tag==1000001) {
            [v removeFromSuperview];
        }
    }
    CGRect orect = _courseCount.frame;

    float y = orect.origin.y-4;
    [_course enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        
        int h = idx%10+1;
        int v= idx/10.0;
        UILabel *l =[[UILabel alloc]init];
        l.text=toStr(obj);
        l.tag = 1000001;
        l.backgroundColor=[UIColor blackColor];
        l.textAlignment=NSTextAlignmentCenter;
        l.textColor=[UIColor whiteColor];
        l.font=[UIFont systemFontOfSize:12];
        l.layer.cornerRadius = 4;
        l.layer.masksToBounds=YES;
        l.frame=CGRectMake(orect.origin.x+orect.size.width+h*23, y+v*23, 19, 19);
        [_supView addSubview:l];
    }];
    
    
}

@end
